package chapter01;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SleepTest {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            try {
                Thread.sleep(2000);// 线程会进入 TIMED_WAITING 状态
                // sleepp运行后恢复RUNNABLE状态
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.info("running...");
        }, "t1");
        t1.start();
        Thread.sleep(1000);
        System.out.println(t1.getState());
        Thread.sleep(1000);
        System.out.println(t1.getState());
    }
}
